package wang.Demo;

import java.util.Random;
import java.util.Scanner;

public class HongBaoDemo5 {
    public static void main(String[] args) {
        //实现抢红包的需求。
        int[] money = {10, 100, 520, 1000, 9999};
        moneys(money);
    }
    public static void moneys(int[] money){
        Scanner sc = new Scanner(System.in);
        Random data = new Random();
        int temp;
        for (int i = 0; i < money.length; i++) {
            temp = money[i];
            int r = data.nextInt(money.length);
            money[i] = money[r];
            money[r] = temp;
        }
        for (int i = 0; i < money.length; i++) {
            System.out.println("请输入任意字符开始抢红包");
            sc.next();
            System.out.println("您抢到的红包金额为 " + money[i] );
        }
        System.out.println("活动结束。。");
    }

}
